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eworCQlyZXR1cm4gJHN0cjsKKwl9CisJCQkJCQkJCQkKKwkkb3V0ID0gIiI7CisJZm9yZWFjaCAoZXhwbG9kZSgnICcsIHRyaW0oJHN0cikpIGFzICR2YWwpCisJeworCQkkb3V0IC49ICR2YWwuJyAnOwkJCQorCQlpZiAoc3RybGVuKCRvdXQpID49ICRuKQorCQl7CisJCQlyZXR1cm4gdHJpbSgkb3V0KS4kZW5kX2NoYXI7IAorCQl9CQkKKwl9Cit9CisJCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworLyoqCisgKiBIaWdoIEFTQ0lJIHRvIEVudGl0aWVzCisgKgorICogQ29udmVydHMgSGlnaCBhc2NpaSB0ZXh0IGFuZCBNUyBXb3JkIHNwZWNpYWwgY2hhcmFjdGVycyB0byBjaGFyYWN0ZXIgZW50aXRpZXMKKyAqCisgKiBAYWNjZXNzCXB1YmxpYworICogQHBhcmFtCXN0cmluZworICogQHJldHVybglzdHJpbmcKKyAqLwkKK2Z1bmN0aW9uIGFzY2lpX3RvX2VudGl0aWVzKCRzdHIpCit7CisgICAkY291bnQJPSAxOworICAgJG91dAk9ICcnOworICAgJHRlbXAJPSBhcnJheSgpOworCSAgIAorICAgZm9yICgkaSA9IDAsICRzID0gc3RybGVuKCRzdHIpOyAkaSA8ICRzOyAkaSsrKQorICAgeworCSAgICRvcmRpbmFsID0gb3JkKCRzdHJbJGldKTsKKwkgICAKKwkgICBpZiAoJG9yZGluYWwgPCAxMjgpCisJICAgeworCQkgICAkb3V0IC49ICRzdHJbJGldOyAgICAgICAgICAgIAorCSAgIH0KKwkgICBlbHNlCisJICAgeworCQkgICBpZiAoY291bnQoJHRlbXApID09IDApCisJCSAgIHsKKwkJCSAgICRjb3VudCA9ICgkb3JkaW5hbCA8IDIyNCkgPyAyIDogMzsKKwkJICAgfQorCQkgICAKKwkJICAgJ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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKwkvKioKKwkgKiBBZGp1c3QgRGF0ZQorCSAqCisJICogVGhpcyBmdW5jdGlvbiBtYWtlcyBzdXJlIHRoYXQgd2UgaGF2ZSBhIHZhbGlkIG1vbnRoL3llYXIuCisJICogRm9yIGV4YW1wbGUsIGlmIHlvdSBzdWJtaXQgMTMgYXMgdGhlIG1vbnRoLCB0aGUgeWVhciB3aWxsCisJICogaW5jcmVtZW50IGFuZCB0aGUgbW9udGggd2lsbCBiZWNvbWUgSmFudWFyeS4KKwkgKgorCSAqIEBhY2Nlc3MJcHVibGljCisJICogQHBhcmFtCWludGVnZXIJdGhlIG1vbnRoCisJICogQHBhcmFtCWludGVnZXIJdGhlIHllYXIKKwkgKiBAcmV0dXJuCWFycmF5CisJICovCisgICAgZnVuY3Rpb24gYWRqdXN0X2RhdGUoJG1vbnRoLCAkeWVhcikKKyAgICB7CisgICAgICAgICRkYXRlID0gYXJyYXkoKTsgCisgICAgICAgICAgICAgICAgCisgICAgICAgICRkYXRlWydtb250aCddCT0gJG1vbnRoOworICAgICAgICAkZGF0ZVsneWVhciddCT0gJHllYXI7CisgICAgICAgIAorICAgICAgICB3aGlsZSAoJGRhdGVbJ21vbnRoJ10gPiAxMikKKyAgICAgICAgeworICAgICAgICAgICAgJGRhdGVbJ21vbnRoJ10gLT0gMTI7CisgICAgICAgICAgICAkZGF0ZVsneWVhciddKys7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHdoaWxlICgkZGF0ZVsnbW9udGgnXSA8PSAwKQorICAgICAgICB7CisgICAgICAgICAgICAkZGF0ZVsnbW9udGgnXSArPSAxMjsKKyAgICAgICAgICAgICRkYXRlWyd5ZWFyJ10tLTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKHN0cmxlbigkZGF0ZVsnbW9udGgnXSkgPT0gMSkKKyAgICAgICAgeworICAgICAgICAJJGR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JGkgPCBzdHJsZW4oJHN0cik7ICRpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgICR4WyRpID4+IDJdIHw9IG9yZChzdWJzdHIoJHN0ciwgJGksIDEpKSA8PCAoMjQgLSAoJGkgJSA0KSAqIDgpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAkeFskaSA+PiAyXSB8PSAweDgwIDw8ICgyNCAtICgkaSAlIDQpICogOCk7CisgICAgICAgIAorICAgICAgICAkeFskbiAqIDE2IC0gMV0gPSBzdHJsZW4oJHN0cikgKiA4OworICAgICAgICAKKyAgICAgICAgJGEgPSAgMTczMjU4NDE5MzsKKyAgICAgICAgJGIgPSAtMjcxNzMzODc5OworICAgICAgICAkYyA9IC0xNzMyNTg0MTk0OworICAgICAgICAkZCA9ICAyNzE3MzM4Nzg7CisgICAgICAgICRlID0gLTEwMDk1ODk3NzY7CisgICAgICAgIAorICAgICAgICBmb3IgKCRpID0gMDsgJGkgPCBzaXplb2YoJHgpOyAkaSArPSAxNikgCisgICAgICAgIHsKKyAgICAgICAgICAgICRvbGRhID0gJGE7CisgICAgICAgICAgICAkb2xkYiA9ICRiOworICAgICAgICAgICAgJG9sZGMgPSAkYzsKKyAgICAgICAgICAgICRvbGRkID0gJGQ7CisgICAgICAgICAgICAkb2xkZSA9ICRlOworICAgICAgICAgICAgCisgICAgICAgICAgICBmb3IoJGogPSAwOyAkaiA8IDgwOyAkaisrKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoJGogPCAxNikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICR3WyRqXSA9ICR4WyRpICsgJGpdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAkd1skal0gPSAkdGhpcy0+X3JvbCgkd1skaiAtIDNdIF4gJHdbJGogLSA4XSBeICR3WyRqIC0gMTRdIF4gJHdbJGogLSAxNl0sIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAkdCA9ICR0aGlzLT5fc2FmZV9hZGQoJHRoaXMtPl9zYWZlX2FkZCgkdGhpcy0+X3JvbCgkYSwgNSksICR0aGlzLT5fZnQoJGosICRiLCAkYywgJGQpKSwgJHRoaXMtPl9zYWZlX2FkZCgkdGhpcy0+X3NhZmVfYWRkKCRlLCAkd1skal0pLCAkdGhpcy0+X2t0KCRqKSkpOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICRlID0gJGQ7CisgICAgICAgICAgICAgICAgJGQgPSAkYzsKKyAgICAgICAgICAgICAgICAkYyA9ICR0aGlzLT5fcm9sKCRiLCAzMCk7CisgICAgICAgICAgICAgICAgJGIgPSAkYTsKKyAgICAgICAgICAgICAgICAkYSA9ICR0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAkYSA9ICR0aGlzLT5fc2FmZV9hZGQoJGEsICRvbGRhKTsKKyAgICAgICAgICAgICRiID0gJHRoaXMtPl9zYWZlX2FkZCgkYiwgJG9sZGIpOworICAgICAgICAgICAgJGMgPSAkdGhpcy0+X3NhZmVfYWRkKCRjLCAkb2xkYyk7CisgICAgICAgICAgICAkZCA9ICR0aGlzLT5fc2FmZV9hZGQoJGQsICRvbGRkKTsKKyAgICAgICAgICAgICRlID0gJHRoaXMtPl9zYWZlX2FkZCgkZSwgJG9sZGUpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICByZXR1cm4gJHRoaXMtPl9oZXgoJGEpLiR0aGlzLT5faGV4KCRiKS4kdGhpcy0+X2hleCgkYykuJHRoaXMtPl9oZXgoJGQpLiR0aGlzLT5faGV4KCRlKTsKKyAgICB9CisgIAkvLyBFTkQgZ2VuZXJhdGUoKQorICAJCisJLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCS8qKgorCSAqIENvbnZlcnQgYSBkZWNpbWFsIHRvIGhleAorCSAqCisJICogQGFjY2Vzcwlwcml2YXRlCisJICogQHBhcmFtCXN0cmluZworCSAqIEByZXR1cm4Jc3RyaW5nCisJICovCQorICAgIGZ1bmN0aW9uIF9oZXgoJHN0cikKKyAgICB7CisgICAgICAgICRzdHIgPSBkZWNoZXgoJHN0cik7CisgICAgICAgIAorICAgICAgICBpZiAoc3RybGVuKCRzdHIpID09IDcpCisgICAgICAgIHsKKyAgICAgICAgICAgICRzdHIgPSAnMCcuJHN0cjsKKyAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgIHJldHVybiAkc3RyOworICAgIH0gICAgCisgIAkvLyBFTkQgX2hleCgpCisgIAkKKwkvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisJLyoqCisJICogIFJldHVybiByZXN1bHQgYmFzZWQgb24gaXRlcmF0aW9uCisJICoKKwkgKiBAYWNjZXNzCXByaXZhdGUKKwkgKiBAcmV0dXJuCXN0cmluZworCSAqLwkKKyAgICBmdW5jdGlvbiBfZnQoJHQsICRiLCAkYywgJGQpIAorICAgIHsKKyAgICAgICAgaWYgKCR0IDwgMjApIAorICAgICAgICAgICAgcmV0dXJuICgkYiAmICRjKSB8ICgofiRiKSAmICRkKTsKKyAgICAgICAgaWYgKCR0IDwgNDApIAorICAgICAgICAgICAgcmV0dXJuICRiIF4gJGMgXiAkZDsKKyAgICAgICAgaWYgKCR0IDwgNjApIAorICAgICAgICAgICAgcmV0dXJuICgkYiAmICRjKSB8ICgkYiAmICRkKSB8ICgkYyAmICRkKTsKKyAgICAgICAgCisgICAgICAgIHJldHVybiAkYiBeICRjIF4gJGQ7CisgICAgfQorICAgIC8vIEVORCBfZnQoKQorICAKKwkvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisJLyoqCisJICogRGV0ZXJtaW5lIHRoZSBhZGRpdGl2ZSBjb25zdGFudAorCSAqCisJICogQGFjY2Vzcwlwcml2YXRlCisJICogQHJldHVybglzdHJpbmcKKwkgKi8JCisgICAgZnVuY3Rpb24gX2t0KCR0KSAKKyAgICB7CisgICAgICAgIGlmICgkdCA8IDIwKSAKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIDE1MTg1MDAyNDk7CisgICAgICAgIH0gCisgICAgICAgIGVsc2UgaWYgKCR0IDwgNDApIAorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gMTg1OTc3NTM5MzsKKyAgICAgICAgfSAKKyAgICAgICAgZWxzZSBpZiAoJHQgPCA2MCkgCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiAtMTg5NDAwNzU4ODsKKyAgICAgICAgfSAKKyAgICAgICAgZWxzZSAKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIC04OTk0OTc1MTQ7CisgICAgICAgIH0KKyAgICB9CisgIAkvLyBFTkQgX2t0KCkKKyAgCQorCS8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKwkvKioKKwkgKiBBZGQgaW50ZWdlcnMsIHdyYXBwaW5nIGF0IDJeMzIKKwkgKgorCSAqIEBhY2Nlc3MJcHJpdmF0ZQorCSAqIEByZXR1cm4Jc3RyaW5nCisJICovCQorICAgIGZ1bmN0aW9uIF9zYWZlX2FkZCgkeCwgJHkpCisgICAgeworICAgICAgICAkbHN3ID0gKCR4ICYgMHhGRkZGKSArICgkeSAmIDB4RkZGRik7CisgICAgICAgICRtc3cgPSAoJHggPj4gMTYpICsgKCR5ID4+IDE2KSArICgkbHN3ID4+IDE2KTsKKyAgICAKKyAgICAgICAgcmV0dXJuICgkbXN3ID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YWdlKCkKKyAgICB7CisgICAgICAgICRpbWdfbWltZXMgPSBhcnJheSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAnaW1hZ2UvZ2lmJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAnaW1hZ2UvanBnJywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2ltYWdlL2pwZScsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2ltYWdlL2pwZWcnLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAnaW1hZ2UvcGpwZWcnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICdpbWFnZS9wbmcnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICdpbWFnZS94LXBuZycKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CisgICAgCisKKwkJcmV0dXJuIChpbl9hcnJheSgkdGhpcy0+ZmlsZV90eXBlLCAkaW1nX21pbWVzKSkgPyBUUlVFIDogRkFMU0U7CisgICAgfQorCQorCS8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisJCisJLyoqCisJICogVmVyaWZ5IHRoYXQgdGhlIGZpbGV0eXBlIGlzIGFsbG93ZWQKKwkgKgorCSAqIEBhY2Nlc3MJcHVibGljCisJICogQHJldHVybglib29sCisJICovCQorICAgIGZ1bmN0aW9uIGlzX2FsbG93ZWRfZmlsZXR5cGUoKQorICAgIHsKKyAgICAJaWYgKGNvdW50KCR0aGlzLT5hbGxvd2VkX3R5cGVzKSA9PSAwKQorICAgIAl7CisJCQkkdGhpcy0+c2V0X2Vycm9yKCd1cGxvYWRfbm9fZmlsZV90eXBlcycpOworCQkJcmV0dXJuIEZBTFNFOworICAgIAl9CisgICAgCSAgICAgCSAKKyAgICAJZm9yZWFjaCAoJHRoaXMtPmFsbG93ZWRfdHlwZXMgYXMgJHZhbCkKKyAgICAJeworICAg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QorCQorCS8qKgorCSAqIFZlcmlmeSB0aGF0IHRoZSBpbWFnZSBpcyB3aXRoaW4gdGhlIGFsbG93ZWQgd2lkdGgvaGVpZ2h0CisJICoKKwkgKiBAYWNjZXNzCXB1YmxpYworCSAqIEByZXR1cm4JYm9vbAorCSAqLwkKKyAgICBmdW5jdGlvbiBpc19hbGxvd2VkX2RpbWVuc2lvbnMoKQorICAgIHsKKyAgICAgICAgaWYgKCAhICR0aGlzLT5pc19pbWFnZSgpKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gVFJVRTsgICAgCisgICAgICAgIH0KKyAgICAKKyAgICAgICAgaWYgKGZ1bmN0aW9uX2V4aXN0cygnZ2V0aW1hZ2VzaXplJykpIAorICAgICAgICB7CisgICAgICAgICAgICAkRCA9IEBnZXRpbWFnZXNpemUoJHRoaXMtPmZpbGVfdGVtcCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmICgkdGhpcy0+bWF4X3dpZHRoID4gMCBBTkQgJERbJzAnXSA+ICR0aGlzLT5tYXhfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoJHRoaXMtPm1heF9oZWlnaHQgPiAwIEFORCAkRFsnMSddID4gJHRoaXMtPm1heF9oZWlnaHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIHJldHVybiBUUlVFOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgfQorCQorCS8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisJCisJLyoqCisJICogVkFsaWRhdGUgVXBsb2FkIFBhdGggCisJICoKKwkgKiBWZX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ZHJlc3MoKSwgJGV4cGlyYXRpb24pOworCSRxdWVyeSA9ICR0aGlzLT5kYi0+cXVlcnkoJHNxbCwgJGJpbmRzKTsKKwkkcm93ID0gJHF1ZXJ5LT5yb3coKTsKKworCWlmICgkcm93LT5jb3VudCA9PSAwKQorCXsKKwkJZWNobyAiWW91IG11c3Qgc3VibWl0IHRoZSB3b3JkIHRoYXQgYXBwZWFycyBpbiB0aGUgaW1hZ2UiOworCX0KKworKi8KKworCisJCisvKioKK3w9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Cit8IENyZWF0ZSBDYXB0Y2hhCit8PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorfAorKi8KK2Z1bmN0aW9uIGNyZWF0ZV9jYXB0Y2hhKCRkYXRhID0gJycsICRpbWdfcGF0aCA9ICcnLCAkaW1nX3VybCA9ICcnLCAkZm9udF9wYXRoID0gJycpCit7CQkKKwkkZGVmYXVsdHMgPSBhcnJheSgnd29yZCcgPT4gJycsICdpbWdfcGF0aCcgPT4gJycsICdpbWdfdXJsJyA9PiAnJywgJ2ltZ193aWR0aCcgPT4gJzE1MCcsICdpbWdfaGVpZ2h0JyA9PiAnMzAnLCAnZm9udF9wYXRoJyA9PiAnJywgJ2V4cGlyYXRpb24nID0+IDcyMDApOwkJCisJCisJZm9yZWFjaCAoJGRlZmF1bHRzIGFzICRrZXkgPT4gJHZhbCkKKwl7CisJCWlmICggISBpc19hcnJheSgkZGF0YSkpCisJCXsKKwkJCWlmICggISBpc3NldCgkJGtleSkgT1IgJCRrZXkgPT0gJycpCisJCQl7CisJCQkJJCRrZXkgPSAkdmFsOworCQkJfQorCQl9CisJCWVsc2UKKwkJewkJCQorCQkJJCRrZXkgPSAoICEgaXNzZXQoJGRhdGFbJGtleV0pKSA/ICR2YWwgOiAkZGF0YVska2V5XTsKKwkJfQorCX0KKwkKKwlpZiAoJGltZ19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3I6IHRyYW5zcGFyZW50OworfQorCisKKyNoZWFkZXIgeworIG1hcmdpbjogMDsKKyBwYWRkaW5nOiAwOworfQorCisjaGVhZGVyX2xlZnQgeworIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50OworIGZsb2F0OiBsZWZ0OworIHBhZGRpbmc6IDIxcHggMCAwIDMycHg7CisgbWFyZ2luOiAwCit9CisKKyNoZWFkZXJfcmlnaHQgeworIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50OworIGZsb2F0OiByaWdodDsKKyB0ZXh0LWFsaWduOiByaWdodDsKKyBwYWRkaW5nOiAzNXB4IDUwcHggMjBweCAwOworIG1hcmdpbjogMAorfQorCisjZm9vdGVyIHsKKyBtYXJnaW46IDIwcHggMCAxNXB4IDA7CisgcGFkZGluZzogMDsKK30KKworI2Zvb3RlciBwIHsKKyBmb250LXNpemU6IDEwcHg7CisgY29sb3I6ICM5OTk7CisgdGV4dC1hbGlnbjogY2VudGVyOworfQorCisjb3V0ZXIgeworIG1hcmdpbjogMzBweCA0MHB4IDAgNDBweDsKK30KKworaW1nIHsKKyBwYWRkaW5nOjA7CisgYm9yZGVyOiAwOworIG1hcmdpbjogMDsKK30KKworLm5vcGFkIHsKKyBwYWRkaW5nOjA7CisgYm9yZGVyOiAwOworIG1hcmdpbjogMDsKK30KKwordGFibGUgeworIGJhY2tncm91bmQtY29sb3I6ICNlZmVmZWY7Cit9CisKK3RoIHsKKyBiYWNrZ3JvdW5kLWNvbG9yOiAjZWVlOworIGZvbnQtd2VpZ2h0OiBib2xkOworIHBhZGRpbmc6IDZweDsKKyB0ZXh0LWFsaWduOiBsZWZ0OworfQorCit0ZCB7CisgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjsKKyBwYWRkaW5nOiA2cHg7Cit9CisKKworZm9ybSB7CisgbWFyZ2luOiAwOworIHBhZGRpbmc6IDA7Cit9CisKKy5pbnB1dCB7CisgZm9udC1mYW1pbHk6IEx1Y2lkYSBHcmF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